numpy get index of n largest values

28

numbers = np.array([1, 3, 2, 4])
n = 2
indices = (-numbers).argsort()[:n]

Comments

Submit
0 Comments